﻿@model TCM.Expense

@{
    ViewBag.Title = "Edit";
}

<h2>Edit Expense</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Expense</legend>
        <ol>
         @Html.HiddenFor(Model=> Model.ExpenseID)


        @*<li class="editor-label">
            @Html.LabelFor(model => model.NameAr)
       
            @Html.EditorFor(model => model.NameAr)
            @Html.ValidationMessageFor(model => model.NameAr)
        </li>*@

        <li class="editor-label">
            @Html.LabelFor(model => model.ExpenseDate)
  
            @Html.EditorFor(model => model.ExpenseDate)
            @Html.ValidationMessageFor(model => model.ExpenseDate)
        </li>
              <li class="editor-label">
            @Html.LabelFor(model => model.ExpenseType)
        
            @Html.DropDownList("ExpenseType", String.Empty)      
           
        </li>
              <li class="editor-label">
            @Html.LabelFor(model => model.Price)
       
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </li>
        <li class="editor-label">
            @Html.LabelFor(model => model.Amount)
        
            @Html.EditorFor(model => model.Amount)
            @Html.ValidationMessageFor(model => model.Amount)
        </li>

       @* <li class="editor-label">
            @Html.LabelFor(model => model.PRICE)
      
            @Html.EditorFor(model => model.PRICE)
            @Html.ValidationMessageFor(model => model.PRICE)
        </li>

        <li class="editor-label">
            @Html.LabelFor(model => model.TOTALEXPENSE)
      
            @Html.EditorFor(model => model.TOTALEXPENSE)
            @Html.ValidationMessageFor(model => model.TOTALEXPENSE)
        </li>*@

        <li class="editor-label">
            @Html.LabelFor(model => model.ResponsibleEmployee)

            @Html.DropDownList("ResponsibleEmployee", String.Empty)
            @Html.ValidationMessageFor(model => model.ResponsibleEmployee)
        </li>

        <li class="editor-label">
         <label> Description</label>
       
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </li>   

        <li class="editor-label">
            @Html.LabelFor(model => model.StatusID)
      
            @Html.DropDownList("StatusID", String.Empty)
            @Html.ValidationMessageFor(model => model.StatusID)
        </li>

         <li class="display-label">
         @Html.DisplayNameFor(model => model.DeleteCode)
       
            @Html.DisplayFor(model => model.DeleteCode)
        </li>
       
          <li class="display-label">
         @Html.DisplayNameFor(model => model.CreatedBy)
       
            @Html.DisplayFor(model => model.CreatedBy)
        </li>               
        <li class="display-label">
         @Html.DisplayNameFor(model => model.CreatedOn)
       
            @Html.DisplayFor(model => model.CreatedOn)
        </li>
        <li class="display-label">
         @Html.DisplayNameFor(model => model.ModifiedOn)
       
            @Html.DisplayFor(model => model.ModifiedOn)
        </li>
               
        <li class="display-label">
         @Html.DisplayNameFor(model => model.ModifiedOn)
       
            @Html.DisplayFor(model => model.ModifiedOn)
        </li>     
          <li class="display-label">
         @Html.DisplayNameFor(model => model.OwnerID)
       
            @Html.DisplayFor(model => model.OwnerID)
        </li>
            
        
        <p>
            <input type="submit" value="Save" />
        </p>
        </ol>
    </fieldset>
}

<li>
    @Html.ActionLink("Back to List", "Index")
</li>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
<script type="text/javascript">

    $('input').blur(function () {
        $('#TotalExpense').val(parseFloat($('#Price').val()) * parseFloat($('#Amount').val()));
    });

</script>